home *** CD-ROM | disk | FTP | other *** search
- // Forward declarations.
- class CLine;
- class CPoint;
- class CLineArray;
- class CPointArray;
-
-
- typedef unsigned long UDWORD;
- typedef long DWORD;
- typedef unsigned short UWORD;
- typedef short WORD;
- typedef unsigned char UBYTE;
- typedef char BYTE;
-
- typedef WORD Index;
- typedef UWORD TextureID;
-
- typedef DWORD Fixed;
- typedef WORD Angle;
-
- typedef BYTE BOOL;
-
-
- // Main structures used throughout.
- //////////////////////////////////////////
-
- typedef struct
- {
- WORD xPos, yPos;
- Fixed xVelocity, yVelocity;
-
- Angle facingAngle;
- } Player;
-
-
- typedef struct
- {
- CLine *pRootLine;
-
- CLineArray *pLines;
- CPointArray *pPoints;
-
- // The palette used in this level.
- BYTE palette[768];
-
- // The texture for the parallaxing sky for this level. (256x128 wall texture.)
- TextureID idCurSky;
- TextureID idSky1, idSky2, idSky3;
- } Level;
-
-
-
-
-
- #define BAD_INDEX 32767
- #define BAD_TEXTURE_ID 65534
-
- #define TRUE 1
- #define FALSE 0
-
- // Angles in the angle system.
- //////////////////////////////////////////
- #define ANGLE_RES 1024
-
- // These are just the values in the ANGLE_RES system.
- #define CIRCLE 1024
- #define PI 512
- #define HALF_PI 256
-
- // The actual program won't use this much.. Just macros
- // to get an angle.
- //////////////////////////////////////////
- #define ANGLE_MASK 1023
-
- // This is what you add to an angle if you want the cosine.
- //////////////////////////////////////////
- #define SIN_TO_COS_ADDER 256
-
-
- #define RADIAN_PI 3.141592654F
- #define RADIAN_HALFPI 1.570796327F
- #define RADIAN_TO_ANGLE(x) ( (Angle)(((float)ANGLE_RES*(float)(x)) / (2.0F * PI)) )
-
-
-
- // Fixed-point macros.
- //////////////////////////////////////////
- #define FIXED_SHIFT ((DWORD)15)
- #define FIXED_ONE (((DWORD)1)<<((DWORD)FIXED_SHIFT))
- #define FIXED_HALF (((DWORD)1)<<((DWORD)(FIXED_SHIFT-1)))
- #define FIX(x) ( (DWORD)((DWORD)(x) << ((DWORD)FIXED_SHIFT)) )
- #define UNFIX(x) ( (x) >> FIXED_SHIFT )
- #define W_UNFIX(x) ( (WORD)((x) >> FIXED_SHIFT) )
- #define R_UNFIX(x) ( (((x)%FIXED_ONE)>(FIXED_HALF)) ? (((x)>>FIXED_SHIFT)+1) : ((x)>>FIXED_SHIFT) )
-
-
- #define DIFF(x,y) ( (x)>(y) ? (x)-(y) : (y)-(x) )
- #define ABS(x) ( (x)<0 ? -(x) : (x) )
- #define SQR(x) ( (x)*(x) )
-
-
-
- // Standard C include files.
- //////////////////////////////////////////
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
- #include <assert.h>
- #include <new.h>
-
-
- // Include files for my sources.
- //////////////////////////////////////////
- #include "..\System\Dynarray.hpp"
-
- #include "..\Source\CLine.hpp"
- #include "..\Source\Globals.hpp"
- #include "..\Source\Bsp.hpp"
- #include "..\Source\Draw.hpp"
- #include "..\Source\Arrays.hpp"
- #include "..\Source\Texture.hpp"
-
- #include "..\System\System.hpp"
- #include "..\Bsp_Gen\Bsp_Gen.hpp"
-
- #include "..\Source\Doom_Tex.hpp"
-
-
-
-
-
-
-
-